package com.zxdemo.scheduledtask;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;

//@Component
public class Task1 {
	private static final SimpleDateFormat dateFormat=new SimpleDateFormat("HH:mm:ss");
	 @Scheduled(fixedRate = 5000)
	    public void reportCurrentTime() {
	        System.out.println("现在时间：" + dateFormat.format(new Date()));
	    }
}
